# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=gst-plugins-good
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.18.0
pkgrel=1
pkgdesc="GStreamer Multimedia Framework Base Plugins (mingw-w64)"
arch=('any')
url="https://gstreamer.freedesktop.org/"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gobject-introspection"
             "${MINGW_PACKAGE_PREFIX}-gtk-doc"
             "${MINGW_PACKAGE_PREFIX}-meson"
             "${MINGW_PACKAGE_PREFIX}-nasm"
             "${MINGW_PACKAGE_PREFIX}-ninja")
depends=("${MINGW_PACKAGE_PREFIX}-bzip2"
         "${MINGW_PACKAGE_PREFIX}-cairo"
         "${MINGW_PACKAGE_PREFIX}-flac"
         "${MINGW_PACKAGE_PREFIX}-gdk-pixbuf2"
         "${MINGW_PACKAGE_PREFIX}-gst-plugins-base"
         "${MINGW_PACKAGE_PREFIX}-gtk3"
         "${MINGW_PACKAGE_PREFIX}-lame"
         "${MINGW_PACKAGE_PREFIX}-libcaca"
         "${MINGW_PACKAGE_PREFIX}-libjpeg"
         "${MINGW_PACKAGE_PREFIX}-libpng"
         "${MINGW_PACKAGE_PREFIX}-libshout"
         "${MINGW_PACKAGE_PREFIX}-libsoup"
         "${MINGW_PACKAGE_PREFIX}-libvpx"
         "${MINGW_PACKAGE_PREFIX}-mpg123"
         "${MINGW_PACKAGE_PREFIX}-speex"
         "${MINGW_PACKAGE_PREFIX}-taglib"
         "${MINGW_PACKAGE_PREFIX}-twolame"
         "${MINGW_PACKAGE_PREFIX}-wavpack"
         "${MINGW_PACKAGE_PREFIX}-zlib")
options=(!libtool strip staticlibs)
conflicts=("${MINGW_PACKAGE_PREFIX}-gst-plugins-ugly<1.14.0"
           "${MINGW_PACKAGE_PREFIX}-gst-plugins-bad<1.16.0")
source=(${url}/src/${_realname}/${_realname}-${pkgver}.tar.xz)
sha256sums=('6329bc377a3afea5cf1ab329a91cc4a906f075781780d1edc59e8bea8c1a8bac')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}

}

build() {
  [[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}"
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"

  ${MINGW_PREFIX}/bin/meson \
    --buildtype plain \
    --wrap-mode=nofallback \
    -Dauto_features=enabled \
    -Dpackage-origin='https://www.msys2.org' \
    -Dtests=disabled \
    -Dexamples=disabled \
    -Doss=disabled \
    -Doss4=disabled \
    -Dosxaudio=disabled \
    -Dosxvideo=disabled \
    -Dosxvideo=disabled \
    -Dpulse=disabled \
    -Dqt5=disabled \
    -Dv4l2=disabled \
    -Dximagesrc=disabled \
    -Daalib=disabled \
    -Djack=disabled \
    -Ddv=disabled \
    -Ddv1394=disabled \
    -Drpicamsrc=disabled \
    -Ddoc=disabled \
    ../${_realname}-${pkgver}

  ninja
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"

  DESTDIR="${pkgdir}${MINGW_PREFIX}" ninja install

  rm -f ${pkgdir}${MINGW_PREFIX}/lib/gstreamer*/*.a
}
